﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace VisionarySystems.TimeRegi.Model.TimePeriods
{
	public enum TimePeriodeType { Unknown = 0, TimeSlot = 1, Workday = 2, WorkWeek = 3, WorkMonth = 4, WorkYear = 5, Controller = 10 } ;

	public interface ITimePeriode : IEnumerable<ITimePeriode>
	{
		TimeSpan WorkedTime { get; }
		int TimeSlotCount { get; }
		int SubClassCount { get; }
		int Year { get; }
		TimePeriodeID ID { get; set; }
		TimeSpan BrakeTime { get; set; }

		void Add(IEnumerable<TimeSlot> TimeSlots);
		TreeNode GetNode();
		bool AssembleTimeslots(out List<TimeSlot> NewTimeSlots, out List<int> RemovedIndexes);
		TimePeriodeType GetTypeID();
		ITimePeriode GetTimePeriode(TimePeriodeID ID);
		IEnumerable<TimeSlot> TimeSlots();

	    /// <summary>
	    /// Returns a time periode that includes all timeslots between StartTime and EndTime
	    /// </summary>
	    /// <param name="StartTime"></param>
	    /// <param name="EndTime"></param>
	    /// <param name="TimePeriod"></param>
	    /// <returns></returns>
	    void GetTimePeriode(DateTime StartTime, DateTime EndTime, ref ITimePeriode TimePeriod);

	    void GetWorkingDates(ref List<DateTime> WorkingDates);
		bool DeleteTimeslots(ref List<int> RemovedIndexes);
		void DeleteTimePeriode(ITimePeriode Periode);
		void DeleteTimeSlot(int Idx);
	}

}
